---
title: 'Elasticsearch'
description: 'Configuring the Elasticsearch backend (Self-Hosted)'
sidebarTitle: 'Elasticsearch'
icon: 'signal-stream'
---

### Getting Started

<img src="https://d15jtxgb40qetw.cloudfront.net/elasticsearch.svg" alt="elasticsearch" className="not-prose h-20" />

{/*
    Add custom content here (under this comment)...

    e.g.

    **Creating Account**<br />
    Go to the **[🔗 website](https://odigos.io) > Account** and click **Sign Up**

    **Obtaining Access Token**<br />
    Go to **⚙️ > Access Tokens** and click **Create New**

    !! Do not remove this comment, this acts as a key indicator in `docs/sync-dest-doc.py` !!
    !! START CUSTOM EDIT !!
*/}

{/*
    !! Do not remove this comment, this acts as a key indicator in `docs/sync-dest-doc.py` !!
    !! END CUSTOM EDIT !!
*/}

### Configuring Destination Fields

<Accordion title="Supported Signals:">
  ✅ Traces
  ❌ Metrics
  ✅ Logs
</Accordion>

- **ELASTICSEARCH_URL** `string` : Elasticsearch URL. Elasticsearch endpoint. Port defaults to `9200` if not specified
  - This field is required
  - Example: `http://host:port`
- **ES_TRACES_INDEX** `string` : Traces Index. The name of the index where traces will be stored
  - This field is optional and defaults to `trace_index`
- **ES_LOGS_INDEX** `string` : Logs Index. The name of the index where logs will be stored.
  - This field is optional and defaults to `log_index`
- **ELASTICSEARCH_BASIC_AUTH_ENABLED** `boolean` : Enable HTTP Basic Authentication.
  - This field is optional and defaults to `False`
- **ELASTICSEARCH_USERNAME** `string` : Username. Username used for HTTP Basic Authentication
  - This field is optional
- **ELASTICSEARCH_PASSWORD** `string` : Password. Password used for HTTP Basic Authentication
  - This field is optional
- **ELASTICSEARCH_TLS_ENABLED** `boolean` : Enable TLS. Secure connection (Transport Layer Security)
  - This field is optional and defaults to `False`
- **ELASTICSEARCH_CA_PEM** `string` : CA Certificate. When using TLS, provide the CA certificate to verify the server. If empty uses system root CA
  - This field is optional
  - Example: `-----BEGIN CERTIFICATE-----`

### Adding Destination to Odigos

There are two primary methods for configuring destinations in Odigos:

##### **Using the UI**

<Steps>
  <Step>
    Use the [Odigos CLI](https://docs.odigos.io/cli/odigos_ui) to access the UI
    ```bash
    odigos ui
    ```
  </Step>
  <Step>
    Click on `Add Destination`, select `Elasticsearch` and follow the on-screen instructions
  </Step>
</Steps>

##### **Using Kubernetes manifests**

<Steps>
  <Step>
    Save the YAML below to a file (e.g. `elasticsearch.yaml`)
    ```yaml
    apiVersion: odigos.io/v1alpha1
    kind: Destination
    metadata:
      name: elasticsearch-example
      namespace: odigos-system
    spec:
      data:
        ELASTICSEARCH_URL: <Elasticsearch URL>
        # Note: The commented fields below are optional.
        # ES_TRACES_INDEX: <Traces Index (default: trace_index)>
        # ES_LOGS_INDEX: <Logs Index (default: log_index)>
        # ELASTICSEARCH_BASIC_AUTH_ENABLED: <Enable HTTP Basic Authentication>
        # ELASTICSEARCH_USERNAME: <Username>
        # ELASTICSEARCH_TLS_ENABLED: <Enable TLS>
        # ELASTICSEARCH_CA_PEM: <CA Certificate>
      destinationName: elasticsearch
      # Uncomment the 'secretRef' below if you are using the optional Secret.
      # secretRef:
      #   name: elasticsearch-secret
      signals:
      - TRACES
      - LOGS
      type: elasticsearch

    ---

    # The following Secret is optional. Uncomment the entire block if you need to use it.
    # apiVersion: v1
    # data:
    #   ELASTICSEARCH_PASSWORD: <Base64 Password>
    # kind: Secret
    # metadata:
    #   name: elasticsearch-secret
    #   namespace: odigos-system
    # type: Opaque
    ```
  </Step>
  <Step>
    Apply the YAML using `kubectl`
    ```bash
    kubectl apply -f elasticsearch.yaml
    ```
  </Step>
</Steps>